import request from '@/utils/request'
/**
 *
 * @returns departmentsList
 */
export const reqGetDepartmentsList = () => {
  return request.get('/company/department')
}
/**
 * 根据id删除部门
 * @param {*} id 部门id
 * @returns
 */
export const reqDelDepartment = id => {
  return request.delete(`/company/department/${id}`)
}
/**
 * 获取员工简单列表
 * @returns staffList
 */
export const reqStaffSimple = () => {
  return request.get('/sys/user/simple')
}

/**
 *
 * @param {*} data 表单信息和父部门id
 * @returns
 */
export const reqAddDepartment = data => {
  return request.post('/company/department', data)
}
/**
 * 根据ID查询部门详情
 * @param {*} id 部门ID
 * @returns
 */
export const reqQueryDepartmentDetail = id => {
  return request.get(`/company/department/${id}`)
}
/**
 * 根据ID修改部门详情
 * @param {*} data
 * @returns
 */
export const reqEditDepartment = data => {
  return request.put(`/company/department/${data.id}`, data)
}
